package com.jason.www.adapter;

import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.jason.www.R;

import org.jetbrains.annotations.NotNull;

/**
 * @author：Jason
 * @date：2020/11/21 10:24
 * @email：1129847330@qq.com
 * @description:
 */
public class TextAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
    public int getTextSize() {
        return textSize;
    }

    public void setTextSize(int textSize) {
        this.textSize = textSize;
        notifyDataSetChanged();
    }

    private int textSize = 16;

    public TextAdapter() {
        super(R.layout.item_list_dialog);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, String s) {
        baseViewHolder.setText(R.id.tv_str, s);
        ((TextView) baseViewHolder.getViewOrNull(R.id.tv_str)).setTextSize(textSize);
    }
}